\documentclass[letterpaper]{article}

%
% Package setup
%

\usepackage[utf8]{inputenc}
\usepackage[scale=0.75]{geometry}
\usepackage{chngpage}
\usepackage{calc}
\usepackage[bottom]{footmisc}

\usepackage{fancybox}
\usepackage{fancyhdr}
\usepackage{lastpage}
%\usepackage{titling}

\usepackage{color}
\usepackage[colorlinks]{hyperref}
\usepackage{graphicx}
\usepackage{float}
\usepackage{listings}


%
% Document Setup
%

\newcommand{\mytitle}{Ruby Software Construction}
\newcommand{\mysubtitle}{Source Code Printout}
\newcommand{\myauthors}%
	{Chandler Carruth, Matthew Holt, Adam Humenansky, Billy Scott}
\newcommand{\myauthorsbrief}{Carruth, Holt, Humenansky, Scott}
\newcommand{\myclassnum}{CSC 631}
\newcommand{\myclassname}{\myclassnum: Software Engineering}
\newcommand{\mysemester}{Spring 2007}

\setlength{\parindent}{0pt}
\addtolength{\parskip}{0.5\baselineskip}

%\raggedright

\newcommand{\Make}{\texttt{Make}}
\newcommand{\Makefile}{\texttt{Makefile}}
\newcommand{\Makefiles}{\texttt{Makefile}s}
\newcommand{\Automake}{\texttt{Automake}}
\newcommand{\Autoconf}{\texttt{Autoconf}}
\newcommand{\Autotools}{\texttt{Autotools}}
\newcommand{\CMake}{\texttt{CMake}}
\newcommand{\JAM}{\texttt{JAM}}
\newcommand{\BoostJAM}{\texttt{Boost::JAM}}
\newcommand{\SCons}{\texttt{SCons}}
\newcommand{\RCons}{\texttt{RCons}}
\newcommand{\rcons}{\texttt{rcons}}

\newcommand{\buildfile}{\textit{build file}}


%
% Package Setup
%

% float package
\restylefloat{figure}

% fancyhdr package
\pagestyle{fancy}

\fancyhf{}
\newlength{\hfoffset}\setlength{\hfoffset}{8pt}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancyhfoffset{\hfoffset}
\lhead{\hspace{\hfoffset}\textsf{\footnotesize \mytitle: \mysubtitle}}
\lfoot{\hspace{\hfoffset}\textsf{\footnotesize \myclassnum, \mysemester}}
\fancyhf[R]{\textsf{\footnotesize \thepage\ of \pageref*{LastPage}}\hspace{\hfoffset}}

\fancypagestyle{title}{%
	\fancyhf{}
	\renewcommand{\headrulewidth}{0pt}
	\renewcommand{\footrulewidth}{0.4pt}
	\lfoot{\hspace{\hfoffset}\textsf{\footnotesize \myclassnum, \mysemester}}
	\rfoot{\textsf{\footnotesize \thepage\ of 
	\pageref*{LastPage}}\hspace{\hfoffset}}}

\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{.\arabic{enumii}}
\renewcommand{\theenumiii}{.\arabic{enumiii}}
\renewcommand{\theenumiv}{.\arabic{enumiv}}

\renewcommand{\labelenumi}{\footnotesize\theenumi}
\renewcommand{\labelenumii}{\footnotesize\theenumi\theenumii}
\renewcommand{\labelenumiii}{\footnotesize\theenumi\theenumii\theenumiii}
\renewcommand{\labelenumiv}{\footnotesize\theenumi\theenumii\theenumiii\theenumiv}

\newcommand{\inputsrc}[1]{\subsubsection*{\lstinline!#1!}\lstinputlisting[firstline=17]{../../#1}}

\begin{document}
\thispagestyle{title}
\begin{adjustwidth}{-8pt}{-8pt}
	\begin{tabular*}{\textwidth+16pt}{@{\hspace{8pt}}l@{\extracolsep{\fill}}r@{\hspace{8pt}}}
		\textbf{\LARGE \mytitle} & \\
		\textbf{\large \mysubtitle}\smallskip & \\
	\end{tabular*}
	\begin{tabular*}{\textwidth+16pt}{@{\hspace{8pt}}l@{\extracolsep{\fill}}r@{\hspace{8pt}}}
		\textsf{\small \myauthors} & \textsf{\small \myclassname} \\
		\hline
	\end{tabular*}
\end{adjustwidth}
\lstset{language=Ruby,tabsize=2}
\lstset{numbers=left, numberstyle=\tiny, stepnumber=1, numbersep=5pt}
\lstset{basicstyle=\footnotesize,breaklines=true}

\inputsrc{lib/rcons/target.rb}
\inputsrc{lib/rcons/environment.rb}
\inputsrc{lib/rcons/build.rb}

\inputsrc{lib/rcons/targets/file_target.rb}
\inputsrc{lib/rcons/targets/source_file_target.rb}
\inputsrc{lib/rcons/targets/tool_target.rb}
\inputsrc{lib/rcons/targets/compiler_target.rb}

\inputsrc{lib/rcons/util/file_change_module.rb}

\inputsrc{lib/rcons/targets/c_cxx/cpp_file_module.rb}
\inputsrc{lib/rcons/targets/c_cxx/c_compiler_target.rb}
\inputsrc{lib/rcons/targets/c_cxx/c_source_file_target.rb}
\inputsrc{lib/rcons/targets/c_cxx/c_application_target.rb}
\inputsrc{lib/rcons/targets/c_cxx/cxx_compiler_target.rb}
\inputsrc{lib/rcons/targets/c_cxx/cxx_source_file_target.rb}
\inputsrc{lib/rcons/targets/c_cxx/cxx_application_target.rb}

\inputsrc{lib/rcons/targets/gcc/gcc_c_compiler_target.rb}
\inputsrc{lib/rcons/targets/gcc/gcc_cxx_compiler_target.rb}

\inputsrc{bin/rcons}

\inputsrc{test/application_test.rb}
\inputsrc{test/application/run_rcons_module.rb}
\inputsrc{test/application/version_test.rb}
\inputsrc{test/build_test.rb}
\inputsrc{test/environment_test.rb}
\inputsrc{test/environment/exec_command_test.rb}
\inputsrc{test/environment/expand_test.rb}
\inputsrc{test/environment/initialize_test.rb}
\inputsrc{test/target_test.rb}
\inputsrc{test/target/initialize_test.rb}
\inputsrc{test/util_test.rb}
\inputsrc{test/util/file_change_test.rb}

\end{document}

